<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // 回调函数：将函数作为参数传递给另外一个函数
        // 作用：将函数内部的值返回给外部
        
        function http(callback){
            var data={"name":"q",age:2};
            callback(data);
        }
        function hanleData(res){
            console.log(res);
        }
        http(hanleData);
        </script>
</body>
</html>